//
//  LMJRadioListCell.m
//  EPA
//
//  Created by lanou3g on 16/4/22.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import "LMJRadioListCell.h"

@interface LMJRadioListCell ()
@property (weak, nonatomic) IBOutlet UIImageView *coverImgView;
@property (weak, nonatomic) IBOutlet UILabel *titleLable;
@property (weak, nonatomic) IBOutlet UILabel *descLable;
@property (weak, nonatomic) IBOutlet UIImageView *iconImgView;
@property (weak, nonatomic) IBOutlet UILabel *unnameLable;





@end
@implementation LMJRadioListCell


-(void)layoutSubviews
{
    self.titleLable.text = self.model.title;
    self.descLable.text = self.model.desc;
//    self.countLable.text=[NSString  stringWithFormat:@"%ld",self.model.count];
//    self.isnewLable.text = [NSString  stringWithFormat:@"%d",self.model.isnew];
    //解析图片
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.model.coverimg]];
    NSURLSessionDataTask *dataTask  = [[NSURLSession sharedSession]dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
        if (data) {
            dispatch_async(dispatch_get_main_queue(), ^{
                self.coverImgView.image = [UIImage imageWithData:data];
            });
        }
    }];
    [dataTask resume];
    //小字典赋值
    [self.iconImgView sd_setImageWithURL:[NSURL URLWithString:self.model.userinfoModel.icon]];
    self.unnameLable.text = self.model.userinfoModel.uname;

    self.iconImgView.layer.cornerRadius = self.iconImgView.frame.size.width/2;
    self.iconImgView.layer.masksToBounds = YES;
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
